Current Location: Home> Function Categories> srand

srand

Sow the random number generator seeds
Name:srand
Category:math
Programming Language:php
One-line Description:Sow the random number generator seeds.

Definition and usage

srand() function sows the random number generator seed.

Example

In this example, we will seed the random number generator:

 <?php
srand ( mktime ( ) ) ;
echo ( rand ( ) ) ;
?>

Try it yourself

grammar

 srand ( seed )
parameter describe
seed Optional. Use seed to sow the random number generator seeds.

illustrate

Starting from PHP version 4.2.0, the seed parameter becomes optional, and when this item is empty, it will be set to any time.

Similar Functions
Popular Articles